<?php
/*
Name: Carbon Paper Controller
Version: 0.1
Author: Bertrand Scarpa
Description: Increase gradually user votes for any posts following goals defined by writer 
Use a distribution profile (Poisson's law)  
*/

// Setting Environment
//define('WP_USE_THEMES', false);
//$uriparts = explode('/',$_SERVER['REQUEST_URI']);
//require_once("{$_SERVER['DOCUMENT_ROOT']}/{$uriparts[1]}/wp-blog-header.php");

//require_once(ABSPATH . '/wp-admin/includes/plugin.php');
//require_once(ABSPATH . WPINC . '/pluggable.php');

class CController{
	
	private static $instance = null;
	
	private function __construct($mode){
		
		
		
   		switch ($mode){
  		case 'options':
  			$this->get_options();
//  			print_r($_POST);
//  			print_r($_GET);
		break;
  		default: 
//			$this->get_profiler();
  		}
	}
	
	public function get_instance($mode){
		if(is_null(self::$instance)) {
			self::$instance = new CController($mode);  
		}
 		return self::$instance;
	}

	public function get_options(){
		// Register Vote Profiler template options
		include_once (PLUGINPATH . 'vote-profiler/options.php');
		$oOptions = COptions::get_instance();
	}
	
	public function get_profiler(){
		include_once(PLUGINPATH . 'vote-profiler/class-profiler.php');
		$oProfiler = CProfiler::get_instance();
		$oProfiler->process();	
		unset($oProfiler);
	}
}
//$oController = CController::get_instance('options');
?>